package com.module.sysconfig.service.impl;

import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.module.sysconfig.dao.ZhysbMapper;
import com.module.sysconfig.entity.Zhysb;
import com.module.sysconfig.service.ZhysbService;
import com.support.cache.annotation.CacheEvict;
import com.support.cache.annotation.Cacheable;
import com.support.cache.annotation.KeyMode;

@Service
public class ZhysbServiceImpl implements ZhysbService
{

	private ZhysbMapper zhysbMapper;
	
	@Autowired
	public void setZhysbMapper(ZhysbMapper zhysbMapper) 
	{
		this.zhysbMapper = zhysbMapper;
	}
	
	/**
	 * 新增系统组合预设表数据
	 */
	@CacheEvict(key="ALL_ZHYSB_RECORD")
	public void saveZhysb(Zhysb zhysb)
	{
		zhysbMapper.saveZhysb(zhysb);
	}

	/**
	 * 更新系统组合预设表数据
	 */
	@CacheEvict(key="ALL_ZHYSB_RECORD")
	public void updateZhysb(Zhysb zhysb) 
	{
		zhysbMapper.updateZhysb(zhysb);
	}

	/**
	 * 删除系统组合预设表数据
	 */
	@CacheEvict(key="ALL_ZHYSB_RECORD")
	public void deleteZhysb(long id) 
	{
		zhysbMapper.deleteZhysb(id);
	}
	
	/**
	 * 根据ID查询系统组合预设表数据
	 * @param id
	 * @return
	 */
	public Zhysb queryZhysbById(long id)
	{
		return zhysbMapper.queryZhysbById(id);
	}
	
	/**
	 * 查询系统组合预设表数据
	 * @return
	 */
	@Cacheable(keyMode=KeyMode.KEY_ONLY, key="ALL_ZHYSB_RECORD")
	public List<Map<String, Object>> queryZhysbRecord()
	{
		return zhysbMapper.queryZhysbRecord();
	}
	
}
